<!DOCTYPE HTML>
<html lang="zh">

<head>
	<meta charset="utf-8">
	<title>支付提示</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0">
	<style>
		body {
			background: #F4F4F8;
			margin: 0;
		}

		.hidden>* {
			display: none;
		}

		body:not(.hidden) .weixin-tip {
			position: absolute;
			top: 15px;
			right: 20px;
			width: 265px;
			padding: 55px 0 0;
			text-align: left;
			background: url(image/tip.png) no-repeat right top;
			background-size: 45px 68px;
		}

		#tip {
			font-weight: bold;
		}

		#tip-img {
			padding: 110px 0 0;
		}

		#tip-img::after {
			display: block;
			margin: 15px auto;
			content: ' ';
			background-size: cover;
		}

		#tip-img.iphone::after {
			width: 150px;
			height: 150px;
			background-image: url(image/tip-iphone.png);
		}

		#tip-img.android::after {
			width: 173px;
			height: 240px;
			background-image: url(image/tip-android.png);
		}
	</style>
</head>

<body class="hidden">
	<div class="weixin-tip">
		请在菜单中选择
		<span id="tip">在浏览器打开</span> ,
		<br> 以完成支付
	</div>
	<div id="tip-img"></div>
	<script src="/scriptZIP/axios.min.js"></script>

	<script>
		(function () {
			if (self !== top) {
				top.location.replace(location.href);
				return;
			}

			var ua = navigator.userAgent.toLowerCase();

			function like(key) {
				return ua.indexOf(key) !== -1;
			}

			if (like('micromessenger')) {
				document.body.classList.remove('hidden');
				if (['iphone', 'ipad', 'ipod'].some(like))
					document.getElementById('tip').innerText = '在Safari中打开';

				onblur = function () {
					onfocus = history.back.bind(history);
				};

				return;
			}

			axios.get('/api/alipay1' + location.search).then(function (res) {
				location.replace(res.data);
			});
		})();
	</script>
</body>

</html>